<?php
/**
 * Created by PhpStorm.
 * User: 86188
 * Date: 2021/12/1
 * Time: 10:43
 */

namespace vendor\core;

require 'person.php';

//### 2.4.4 继承
class student extends person
{
    private $class;
    public static $type;

    //### 2.4.7 静态属性和方法
    public static function setType($type)
    {
        student::$type = $type;
    }

    public function __construct($name, $age, $gender)
    {
        $this->class='1班';
        student::$type='学生';

        //### 2.4.6 调用父类的构造方法和普通方法

        parent::__construct($name, $age, $gender);
    }

    public function eat()
    {
        parent::eat();
        echo '餐厅 eat';
        echo '<br>';
    }
}
